package com.hzx.demo.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.hzx.demo.R;
import com.hzx.demo.util.Entry;
import com.hzx.demo.util.HZXLog;
import com.hzx.demo.view.ImageViewPopupWindow;

/**
 * Created by ke on 16-5-14.
 */
@Entry(desc = "拥有触摸事件， 可放大缩小的一个ImageView", createTime = "2016-05-14 21:08")
public class TouchImageViewActivity extends AppCompatActivity{
    @SuppressWarnings("unused")
    private static final String TAG = "TouchImageViewActivity";

    private ImageViewPopupWindow mImageViewPopupWindow;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_touch_image_view);
    }

    public void onClick(View view){
        HZXLog.v(TAG, "onClick");
        mImageViewPopupWindow = new ImageViewPopupWindow();
        mImageViewPopupWindow.show(TouchImageViewActivity.this, null);
    }

    @Override
    public void onBackPressed() {
        if(mImageViewPopupWindow.isShowing()){
            mImageViewPopupWindow.dismissPopupWindow();
        }else{
            super.onBackPressed();
        }
    }
}
